package com.music.controller;

import com.github.pagehelper.PageInfo;
import com.music.dto.Result;
import com.music.entity.Singer;
import com.music.entity.SingerType;
import com.music.service.SingerService;
import com.music.service.SingerTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/SingerType")
@Slf4j
public class SingerTypeController {
    @Autowired
    private SingerTypeService singerTypeService;

    @GetMapping("/getSingerType")
    public @ResponseBody Result getSingerType(){
        Result result = new Result();
        List<SingerType> singerTypes = singerTypeService.getsingerType();
        if (singerTypes != null){
            result.ok(singerTypes);
        }else {
            result.fail(0,"无数据");
        }
        return result;
    }
}
